package com.rc.saas.tenant.service.order;


import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.base.BaseService;
import com.rc.saas.tenant.common.vo.log.OrderTraceVo;
import com.rc.saas.tenant.mapper.order.OrderInfoMapper;
import com.rc.saas.tenant.model.elec.ElecStationPrice;
import com.rc.saas.tenant.model.order.HlhtOrderInfo;
import com.rc.saas.tenant.model.order.OrderInfo;
import com.rc.saas.tenant.model.order.OrderInfoExample;
import com.rc.saas.tenant.search.enterprise.EnterpriseOrderSearch;
import com.rc.saas.tenant.search.hlht.HlhtOrderSearch;
import com.rc.saas.tenant.search.order.*;
import com.rc.saas.tenant.search.statistics.ChargeStatisticsSearch;
import com.rc.saas.tenant.vo.elec.ChargeLeaderboard;
import com.rc.saas.tenant.vo.hlht.HlhtOrderPrintVo;
import com.rc.saas.tenant.vo.log.ChargedProcessLog;
import com.rc.saas.tenant.vo.order.OrderAllDataVo;
import com.rc.saas.tenant.vo.order.OrderPrintVo;
import com.rc.saas.tenant.vo.order.OrderResult;
import com.rc.saas.tenant.vo.order.OrderTotalData;
import com.rc.saas.tenant.vo.statistics.ChargingStatisticsVo;
import com.rc.saas.tenant.vo.statistics.OperatorPowerTimePeriodVo;
import com.rc.saas.tenant.vo.statistics.OrderChargingStatisticsVo;
import com.rc.saas.tenant.vo.statistics.StatisticsQueryVo;
import com.rc.saas.tenant.vo.order.*;

import java.text.ParseException;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderInfoService extends BaseService<Long, OrderInfo, OrderInfoExample, OrderInfoMapper> {
    Long insertReturnId(OrderInfo orderInfo);

//    void updateOrderByMongDb(ChargedProcessLog processLog);

    OrderAllDataVo selectTenantOrderByDay(String tenantCode, String dateType, OrderAllDataVo orderAllDataVo);

    OrderInfo selectOrderInfoByMigrateId(String tenantCode, String hlhtOrderType, Long migrateId);

    List<ChargeLeaderboard> listStationChargeLeaderboard(String tenantCode);

    List<ChargeLeaderboard> listStationChargeLeaderboardOperator(String tenantOperatorCode);

    OrderAllDataVo selectTenantOrderByDayOperator(String tenantOperatorCode, String dateType, OrderAllDataVo orderAllDataVo);

    PageInfo<OrderResult> listPageEnterpriseOrder(EnterpriseOrderSearch enterpriseOrderSearch);

    List<OrderPrintVo> exportEnterpriseOrder(EnterpriseOrderSearch enterpriseOrderSearch);

    PageInfo<OrderResult> listPageByCondition(OrderSearch orderSearchVo);

    List<OrderResult> listByCondition(OrderSearch orderSearchVo);

    PageInfo<OrderResult> listPageHlhtOrderInfo(HlhtOrderInfoSearch hlhtOrderInfoSearch);

    PageInfo<OrderResult> listByExceptionOrderCondition(ExceptionOrderInfoSearch exceptionOrderInfoSearch);

    //PageInfo<OrderTotalData> listPageTotalData1(OrderTotalDataSearch orderTotalDataSearchVo);

    //List<OrderTotalDataPrintVo> exportTotalData(OrderTotalDataSearch orderTotalDataSearchVo);

   /* List<OrderPrintVo> exportOrderInfo(OrderSearch elecSationSearch);*/

    //PageInfo<OrderResult> listPageOperatorOrderInfo(OrderSearch orderSearch);

   // List<OrderPrintVo> listOperatorOrderInfo(OrderSearch orderSearch);

    /**
     * 查询订单每小时充电量(统计数据)
     */
    List<ChargingStatisticsVo> listChargingStatistics(StatisticsQueryVo statisticsQueryVo);

    /**
     * 统计订单数据
     */
   // OrderInfoCountVo countOrderInfo(OrderInfoStatisticsSearch orderInfoStatisticsSearch);

   // List<OrderInfoCountPrintVo> listCountOrderInfo(OrderInfoStatisticsSearch orderInfoStatisticsSearch);

    /**
     * 查询订单每小时充电量(统计数据订单列表)
     */
    PageInfo<OrderChargingStatisticsVo> listOrderChargingStatistics(StatisticsQueryVo statisticsQueryVo);

    /**
     * 根据id查询订单详情
     */
    OrderResult selectOrderInfo(Long orderId);

    /**
     * 查询充电加盟数据
     * @param stationName 站点名称
     * @param provinceId  省份ID
     * @param cityId  城市ID
     * @param areaId  区/县ID
     * @param bizType  类型（0:自营充电，1:加盟商）
     * @return
     */
    Map<String,Object> getStatementData(String stationName,String provinceId,String cityId,String areaId,String bizType);

    /**
     * 查询分销商峰平谷电量
     */
    List<OperatorPowerTimePeriodVo> listOperatorPowerTimePeriod(List<ElecStationPrice> list, StatisticsQueryVo statisticsQueryVo);

    /**
     * 查询用户是否存在充电中订单
     */
    long countOrderIsCharging(Long memberId);

    /**
     * 按外部订单号查找outOrderNum
     */
    OrderInfo selectOrderInfoByOutOrderNum(String outOrderNum);

    /**
     * 通过迁移ID查询（迁移专用）
     */
    //OrderInfo selectOrderInfoByMigrateId(String tenantCode, Long migrateId);

    /**
     * （迁移专用）
     */
    PageInfo<OrderInfo> listhlht1PageOrder(Long memberId, int pageIndex, int pageSize);

    /**
     * 按年度查找
     */
    //PageInfo<OrderInfo> listOrderInfoByYear(Integer year, int pageIndex, int pageSize);

    /**
     * 按日期查找
     */
    //PageInfo<OrderInfo> listOrderInfoByDay(Date createdTime, int pageIndex, int pageSize);

    OrderInfo selectOrderByOrderNum(String orderNum);

    //AcctRuleOrderResult AcctRuleOrder(String TenantCode, Long elecStationId, String startTime, String endTime) throws ParseException;

    List<ExceptionOrderPrintVo> exportExceptionOrderInfo(ExceptionOrderInfoSearch orderSearch);

    PageInfo<OrderResult> listPageOperatorExceptionOrderInfo(ExceptionOrderInfoSearch orderSearch);

    HlhtOrderInfo selectHlhtOrderInfoByOrderId(Long orderId);

    List<ExceptionOrderPrintVo> exportOperatorExceptionOrderInfo(ExceptionOrderInfoSearch exceptionOrderInfoSearch);

    List<HlhtOrderInfoPrintVo> exportHlhtOrderInfo(HlhtOrderInfoSearch hlhtOrderInfoSearch);

    PageInfo<SaasOrderTotalData> listPageSaasTotalData1(OrderTotalDataSearch orderTotalDataSearchVo);

    List<SaasOrderTotalDataPrintVo> exportSaasTotalData(OrderTotalDataSearch orderTotalDataSearchVo);

    SaasOrderInfoCountVo saasCountOrderInfo(OrderTotalDataSearch orderTotalDataSearch);

    List<SaasOrderInfoCountPrintVo> listSaasCountOrderInfo(OrderTotalDataSearch orderTotalDataSearch);

    List<OrderResult> listOrderInIds(List<Long> ids);

    List<ChargeStatisticsResult> listChargeStatistics(ChargeStatisticsSearch search);

    List<OrderTraceVo> listOrderTrace(OrderTraceVo orderTraceVo);
}
